// << Insertion >> Extraction Stream Overloading using Friend Function
#include <iostream>
using namespace std;

class Complex
{
    private:
        int a, b;
    public:
        void setData(int x, int y)
        {
            a=x;b=y;
        }
        friend ostream & operator<<(ostream& out, Complex C);
        friend istream & operator>>(istream& in, Complex &C);
};

ostream & operator<<(ostream &out, Complex C)
{
    out << C.a << " " << C.b << endl;
    return out;
}
istream & operator>>(istream &in, Complex &C)
{
    in >> C.a >> C.b;
    return in;
}

int main()
{
    Complex c1, c2;
    cin >> c1 >> c2;
    cout << c1 << c2 << endl;
}